﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace VueShopApi.Entities 
{
	/// <summary>
	/// 订单表
	/// </summary>
	[JsonObject(MemberSerialization.OptIn), Table(Name = "sp_order", DisableSyncStructure = true)]
	public partial class SpOrder 
	{
		/// <summary>
		/// 主键id
		/// </summary>
		[JsonProperty("order_id"), Column(Name = "order_id", IsPrimary = true, IsIdentity = true)]
		public int OrderId { get; set; }

		/// <summary>
		/// consignee收货人地址
		/// </summary>
		[JsonProperty("consignee_addr"), Column(Name = "consignee_addr", StringLength = -1, IsNullable = false)]
		public string ConsigneeAddr { get; set; }

		/// <summary>
		/// 记录生成时间
		/// </summary>
		[JsonProperty("create_time"), Column(Name = "create_time")]
		public int CreateTime { get; set; }

		/// <summary>
		/// 订单是否已经发货
		/// </summary>
		[JsonProperty("is_send"), Column(Name = "is_send", InsertValueSql = "'否'")]
		public string IsSend { get; set; }

		/// <summary>
		/// 公司名称
		/// </summary>
		[JsonProperty("order_fapiao_company"), Column(Name = "order_fapiao_company", StringLength = 32, IsNullable = false)]
		public string OrderFapiaoCompany { get; set; }

		/// <summary>
		/// 发票内容
		/// </summary>
		[JsonProperty("order_fapiao_content"), Column(Name = "order_fapiao_content", StringLength = 32, IsNullable = false)]
		public string OrderFapiaoContent { get; set; }

		/// <summary>
		/// 发票抬头 个人 公司
		/// </summary>
		[JsonProperty("order_fapiao_title"), Column(Name = "order_fapiao_title", InsertValueSql = "'个人'")]
		public string OrderFapiaoTitle { get; set; }

		/// <summary>
		/// 订单编号
		/// </summary>
		[JsonProperty("order_number"), Column(Name = "order_number", StringLength = 32, IsNullable = false)]
		public string OrderNumber { get; set; }

		/// <summary>
		/// 支付方式  0未支付 1支付宝  2微信  3银行卡
		/// </summary>
		[JsonProperty("order_pay"), Column(Name = "order_pay", InsertValueSql = "'1'")]
		public int OrderPay { get; set; }

		/// <summary>
		/// 订单总金额
		/// </summary>
		[JsonProperty("order_price"), Column(Name = "order_price")]
		public decimal OrderPrice { get; set; } = 0.00M;

		/// <summary>
		/// 订单状态： 0未付款、1已付款
		/// </summary>
		[JsonProperty("pay_status"), Column(Name = "pay_status", InsertValueSql = "'0'")]
		public int PayStatus { get; set; }

		/// <summary>
		/// 支付宝交易流水号码
		/// </summary>
		[JsonProperty("trade_no"), Column(Name = "trade_no", StringLength = 32, IsNullable = false)]
		public string TradeNo { get; set; }

		/// <summary>
		/// 记录修改时间
		/// </summary>
		[JsonProperty("update_time"), Column(Name = "update_time")]
		public int UpdateTime { get; set; }

		/// <summary>
		/// 下订单会员id
		/// </summary>
		[JsonProperty("user_id"), Column(Name = "user_id", DbType = "mediumint(8) unsigned")]
		public int UserId { get; set; }

	}

	public enum SpOrderISSEND {
		是 = 1, 否
	}
	public enum SpOrderORDERFAPIAOTITLE {
		个人 = 1, 公司
	}
	public enum SpOrderORDERPAY {
		/// <summary>
/// 0
/// </summary>
[Description("0")]
Unknow1 = 1, 
/// <summary>
/// 1
/// </summary>
[Description("1")]
Unknow2, 
/// <summary>
/// 2
/// </summary>
[Description("2")]
Unknow3, 
/// <summary>
/// 3
/// </summary>
[Description("3")]
Unknow4
	}
	public enum SpOrderPAYSTATUS {
		/// <summary>
/// 0
/// </summary>
[Description("0")]
Unknow1 = 1, 
/// <summary>
/// 1
/// </summary>
[Description("1")]
Unknow2
	}
}
